<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title><?=$this->lang->line('site_title');?></title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>	
	<meta http-equiv="cache-control" content="max-age=0" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />
	<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
	<meta http-equiv="pragma" content="no-cache" />

	<link rel="stylesheet" href="<?=base_url()?>assets/css/jquery-ui-1.10.2.custom.min.css" />
	<?php
	if( !stristr($_SERVER['HTTP_USER_AGENT'],'android') ){
		echo '<link rel="stylesheet" href="'.base_url().'assets/css/jquery-ui-extend-for-surface.css" />';
	} 
	?>
	<link rel="stylesheet" href="<?=base_url()?>assets/css/jquery.ui.chatbox.css" />
	<link rel="stylesheet" href="<?=base_url()?>assets/css/kendo.common.min.css" />
	<link rel="stylesheet" href="<?=base_url()?>assets/css/kendo.default.min.css" />
	<link rel="stylesheet" href="<?=base_url()?>assets/css/style.css" />
	<link rel="stylesheet" href="<?=base_url()?>assets/css/text-buble.css" />
	<link rel="stylesheet" href="<?=base_url()?>assets/css/icons.css" />
	<link rel="stylesheet" href="<?=base_url()?>assets/css/contextmenu.css" />
	<link rel="stylesheet" href="<?=base_url()?>assets/css/jPicker-1.1.6.css" />
	<link rel="stylesheet" href="<?=base_url()?>assets/css/jquery.touchpanview.css" />
	<link rel="stylesheet" href="<?=base_url()?>assets/css/core.css" type="text/css" media="print" />
	
	
	<!-- Le fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="assets/ico/favicon.png">
	
	
	<script src="<?=$this->config->item('awb_node_server_ip');?>:<?=$this->config->item('awb_node_server_port');?>/socket.io/socket.io.js"></script>
	<script src="<?=base_url()?>assets/js/libs/json2.min.js"></script>
	<script src="<?=base_url()?>assets/js/libs/l10n.min.js"></script>
	<script src="<?=base_url()?>assets/js/libs/localizations.js"></script>

	<script type="text/javascript"> 
	var filename="<?=$file_name?>";
    function toggle_visibility(id) { 
       var e = document.getElementById(id);
       var a = document.getElementById('maximize');
       if(e.style.display == 'block'){
          e.style.display = 'none';
          a.style.display = 'block';
        
		  }
       else{
          e.style.display = 'block';
          a.style.display = 'none';
		  }
		App.draw.updateDrawCanvasSize();
    }
	
	function max_visibility(id) {
       var e = document.getElementById(id);
	   var a = document.getElementById('maximize');
       if(a.style.display == 'block'){
          a.style.display = 'none';
          e.style.display = 'block';
		  }
       else{
          a.style.display = 'block';
          e.style.display = 'none';
		  }
		App.draw.updateDrawCanvasSize();
    }
	
	
	function onnload(){ 
		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ // MSIE x.x; 
			var ieversion=new Number(RegExp.$1);
			if(ieversion<9){
				alert("This application is compatible with Internet Explorer 9+"); 
				window.location.href = baseurl + "auth/logout"; 
			}
		}
	}
	window.onload = onnload;
	</script>
	
</head>

<body id="draw_body" oncontextmenu='return false;'>
<div id="overlay-event"></div>
	<div id="overlay" style="display:block">
		<img id="img-loading" src="<?=base_url()?>assets/css/images/ajax_loader.gif" alt="Loading" />
	</div>
<?=$toolbox_dialog?>
<?=$upload_dialog?>
<?=$uploadFile_dialog?>
<?=$page_file_dialog?>
<?=$save_as_dialog?>
<?=$chart_dialog?>
<?=$pick_color_dialog?>
<?=$text_logo_dialog?>
<?=$property_dialog?>
<?=$open_file_dialog?>
<?=$open_file_template_dialog?>
<?=$recover_dialog?>
<?=$lock_object_dialog?>
<?=$unlock_object_dialog?>
<?=$dialog_list_user?>
<?=$create_page_dialog?>

<div id="nic-edit-panel-container">
	<table class="table table-center bg-white table-border-black">
		<tr><td class="title bg-draw-blue color-white"><?=$this->lang->line('text_toolbox_title');?></td></tr>
		<tr><td><div id="nic-edit-panel"></div></td></tr>
		<tr><td><input type="button" value="<?=$this->lang->line('value_cancel');?>" id="text-cancel" class="right" style="margin-left:5px;"/>
		<input type="button" value="<?=$this->lang->line('value_save');?>" id="text-save" class="right"/></td></tr>
	</table>
</div>

<div id="nic-sticky-edit-panel-container">
	<table class="table table-center bg-white table-border-black">
		<tr><td class="title bg-draw-blue color-white"><?=$this->lang->line('sticky_toolbox_title');?></td></tr>
		<tr><td><div id="nic-sticky-edit-panel"></div>
			<div>
				<?=$this->lang->line('sticky_note_color');?> : <label value="Color : " id="stickyJPicker"/><!--<input  id="stickyJPicker" class="jPicker" type="hidden" value="fda0f7" />-->
			</div>
		</td></tr>
		<tr><td><input type="button" value="<?=$this->lang->line('value_cancel');?>" id="sticky-text-cancel" class="right" style="margin-left:5px;"/>
		<input type="button" value="<?=$this->lang->line('value_save');?>" id="sticky-text-save" class="right"/></td></tr>
	</table>
</div>

<?=$toolboxStamp_dialog?>
<!-- ulum -->
<?=$toolboxBubble_dialog?>
<?=$toolboxSticky_dialog?>
<!-- ulumxxx-->
<?=$initial_table_dialog?>
<?=$rotation_dialog?>


<section class="contents">	
	
	<div id="maximize"><a href="#" onclick="max_visibility('header');"><div class="button_maximize"></div></a></div>
	
	<div id="header" class="span12" style="margin-left:0px;display:block;">
	
	<div class="row-fluid">
	
		<a class="logo"><img src="<?=base_url()?>assets/css/images/logo1.png"></a>
		
		<div class="cloud">
			<div class="tabs toolbox desktop-size">
				<div class="tab">
					<input type="radio" id="tab-1" name="tab-group-1" checked>
					<label onClick="App.toggleMode(0);"  id="view_tab" for="tab-1"><img src="<?=base_url()?>assets/css/images/icon-tab1.png"><?=$this->lang->line('view_mode');?></label>
           
		            <div class="content-tabs">
						<a title="<?=$this->lang->line('tooltip_open_file');?>"  class="ico-open-file  open-file-workspace" ></a>
						<a title="<?=$this->lang->line('tooltip_open_file_template');?>"  class="ico-open-file-template open-file-template-workspace" ></a>
						<a title="<?=$this->lang->line('tooltip_player');?>"  class="ico-player" onclick='App.openPlayerWindow()'></a>
						<a title="<?=$this->lang->line('tooltip_preview');?>" class="icon_preview" onClick="App.goToPreview()"></a>
						<a title="<?=$this->lang->line('tooltip_user_list');?>"  class="ico-list-user drawcanvas list-user" style="margin-top:0px;"></a>
						<a title="<?=$this->lang->line('tooltip_pan');?>" class="ico-hand pan-tools" style="margin-top:5px;"></a>
			
		           </div> 
				</div>
        
			
        <div class="tab">
				<input type="radio" id="tab-2" name="tab-group-1">
				<label onClick="App.toggleMode(1);"  id="edit_tab" for="tab-2"><img src="<?=base_url()?>assets/css/images/icon-tab2.png"><?=$this->lang->line('edit_mode');?></label>
           
	            <div class="content-tabs">
					<a id="tool_shape_ico" title="<?=$this->lang->line('tooltip_shape');?>" class="icon_shape floating-tools exclusive_tool"></a>	
					<a id="tool_upload_img_ico" title="<?=$this->lang->line('tooltip_upl_image');?>" class="icon_pic uplimg-tools exclusive_tool"></a>
					<!--<a id="tool_pencil_ico" title="<?=$this->lang->line('tooltip_pencil');?>" class="icon_pencil_blue floating-tools-pen exclusive_tool"></a>-->
					<a id="tool_text_ico" title="<?=$this->lang->line('tooltip_text');?>" class="icon_text_edit text-edit-tools exclusive_tool"></a>
					<a id="tool_text_bubble_ico" title="<?=$this->lang->line('tooltip_text_baloon');?>" class="icon_text_bubble text-edit-bubble-tools exclusive_tool"></a>
					<a id="tool_text_sticky_ico" title="<?=$this->lang->line('tooltip_sticky_text');?>" class="icon_sticky sticky-text-tools exclusive_tool"></a>
					<a id="tool_stamp_ico" title="<?=$this->lang->line('tooltip_stamp');?>" class="icon_stamp stamp-tools exclusive_tool"></a>
					<!--<a id="tool_upload_file_ico" title="<?=$this->lang->line('tooltip_file_attach');?>" class="icon_attach upl-file-tools exclusive_tool"></a>-->
					<a id="tool_table_ico" title="<?=$this->lang->line('tooltip_table');?>" class="icon_table table-tools exclusive_tool"></a>
					<div class="separator"></div>
					<a title="<?=$this->lang->line('tooltip_undo');?>"  onclick="App.undo()" class="icon_recycle icon_undo"></a>
					<a title="<?=$this->lang->line('tooltip_redo');?>"  onclick="App.redo()"  class="icon_recycle icon_redo"></a>
					<!--<a id="tool_chart_ico" title="<?=$this->lang->line('tooltip_chart');?>" class="icon_chart chart-tools exclusive_tool" style="margin-top:0px;"></a>-->
					<div class="separator"></div>
				<!--<a title="<?=$this->lang->line('tooltip_recover');?>" class="icon_recycle recover-tool"></a>-->
					<a title="<?=$this->lang->line('tooltip_delete_obj');?>" onclick="App.deleteObject()" class="ico-eraser-obj drawcanvas" style="margin-top:0px;"></a>
					<a title="<?=$this->lang->line('tooltip_copy_obj');?>"  onclick="App.copyObject()" class="ico-copy-paste drawcanvas" style="margin-top:0px;"></a>			
					<a title="<?=$this->lang->line('value_reset_background');?>" class="ico-delete-bg reset-bg-tools" style="margin-top:5px;"></a>
					<a title="<?=$this->lang->line('value_grid');?>" class="ico-grid property-tools"></a>
	           </div> 
		</div>
        <div class="tab">
           <input type="radio" id="tab-3" name="tab-group-1">
           <label onClick="App.toggleMode(2);" id="page_tab" for="tab-3"><img src="<?=base_url()?>assets/css/images/icon-tab3.png"><?=$this->lang->line('page_mode');?></label>
         
           <div class="content-tabs">
				

				<a title="<?=$this->lang->line('tooltip_new_file');?>"  class="ico-new-file page-file-new" /></a>		
				<a title="<?=$this->lang->line('tooltip_save_as');?>" class="ico-disk-save save-as-file"></a>
				<a title="<?=$this->lang->line('tooltip_delete_file');?>"  class="ico-eraser-file" onclick="App.deleteFile()"></a>
				<div class="separator"></div>
				<a title="<?=$this->lang->line('tooltip_new_page');?>"   class="ico-new-page drawcanvas page-new" style="margin-top:0px;"></a>	
				<a title="<?=$this->lang->line('tooltip_del_page');?>"  class="ico-eraser-page" onclick="App.deletepage()"></a>		
				<div class="separator"></div>
				<a title="<?=$this->lang->line('tooltip_print');?>" class="ico-print-file print-area-tools print" rel="content"></a>
				<a title="<?=$this->lang->line('tooltip_pan');?>" class="ico-hand pan-tools" style="margin-top:5px;"></a>
           </div> 
       </div>
        
    </div>
		</div>
		
		<div class="menubox desktop-size">
			
			<a title="<?=$this->lang->line('tooltip_home');?>" class="ico-home"></a>
			<!--<a title="<?=$this->lang->line('tooltip_open_file');?>" class="ico-folder-open open-file-workspace" ></a>
			<a title="<?=$this->lang->line('tooltip_open_file_template');?>" class="ico-open-template-page open-file-template-workspace" ></a>
			
		
			<div class="switch switch-large" data-on-label="<?=$this->lang->line('view_mode');?>" data-off-label="<?=$this->lang->line('edit_mode');?>">
                <input id="toggle_check_box" type="checkbox" checked />
            </div>-->
			<!--<input type="button" title="<?=$this->lang->line('tooltip_edit_view_mode');?>" value="<?=$this->lang->line('edit_mode');?>" class="right button-mode toggle_mode_buttons" onClick="App.toggleMode(0);" style="margin-left:5px;"/>-->
		</div>	
		
		<a href="#" title="<?=$this->lang->line('tooltip_minimize_upper_bar');?>" onclick="toggle_visibility('header');"><div class="button_minimize"></div></a>
		<!--
		<div class="toolbox desktop-size">
		<a title="<?=$this->lang->line('tooltip_player');?>"  class="ico-player" id="dummy-button"></a>
		</div>
		-->
	</div>
	</div>
	<table class="content" style="">
		<tr>
			<td class="layers" id="page_thumbnails">
				<div id="show-floating-menu-small" style="z-index:99998;padding:5px;border:1px solid black;background:-moz-linear-gradient(center top , #F2F9FE 5%, #D6F0FD 100%) repeat scroll 0 0 transparent;display:none;">
	<div class="menubox-small bg-draw-blue" style="display:inline-block;width:100%;">
		<input type="button" value="Toolbox" class="right button-mode small-menu-toggle" style="margin-left:5px;"/>
	</div>
</div>
				<a class="minimize_parent" title="<?=$this->lang->line('tooltip_minimize_upper_bar');?>" style="z-index:23;">-</a>
				<span id="layerstitle"><?=$this->lang->line('layer_title');?></span>
				
				<div class="layerboxContainer" id="page-list-container"></div>
			</td>
			<td class="drawContainer" id="mainCanvas">
			
				<span class="titlespan file_title"></span>
				<div id="pan-container">
					<a class="maximize_parent" style="z-index:23;display:none;left:0px;"></a>
					<div id="rootContainer"></div>
					<div id="kineticCanvas"></div>
					<div id="kineticExporterCanvas"></div>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<div id="chat_div"></div>
			</td>
		</tr>
	</table>
</section>
<input id="base_url" type="hidden" value="<?=base_url();?>"/>
<input id="node_url" type="hidden" value="<?=$this->config->item('awb_node_server_ip');?>:<?=$this->config->item('awb_node_server_port');?>"/>
<input id="file_id" type="hidden" value="<?=$file_id;?>"/>
<input id="file_name" type="hidden" value="<?=$file_name?>"/>
<input id="page_id" type="hidden" value="<?=$page_id;?>"/>
<input id="u_name" type="hidden" value="<?=$user->username;?>"/>
<input id="is_teacher" type="hidden" value="<?=$user->role=="STUDENT"?0:1;?>"/>
<input id="u_id" type="hidden" value="<?=$user->id;?>"/>
<input id="group_name" type="hidden" value="<?=$group_name;?>"/>
<input id="app_lang" type="hidden" value="<?=$this->config->item('language');?>"/>
<script type="text/javascript" src="<?=base_url()?>assets/js/libs/require.js" data-main="<?=base_url()?>assets/js/main-draw"></script>
<script type="text/javascript">
	/*console.log("setting size : " + document.documentElement.clientWidth + "," + document.documentElement.clientHeight);
	document.getElementById('mainCanvas').style.width = document.documentElement.clientWidth + "px";
	document.getElementById('mainCanvas').style.height = document.documentElement.clientHeight + "px";*/
</script>

</body>
</html>
